FROM ubuntu:20.04

LABEL maintainer="mengzheng"

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && \
    apt-get install -y nginx openjdk-17-jdk curl net-tools iputils-ping unzip telnet && \
    apt-get clean

WORKDIR /data
COPY data/datax ./datax
COPY data/flink ./flink
COPY data/onlinetask_client ./onlinetask_client
COPY data/dependency ./dependency
COPY data/data-integration-engine-start-1.0.0-SNAPSHOT.jar ./data-integration-engine-start-1.0.0-SNAPSHOT.jar
COPY data/dist.zip ./dist.zip
COPY conf/data-engine.conf /etc/nginx/conf.d/default.conf
ADD entrypoint.sh ./

VOLUME /data/log

ENV SPRING_PROFILES_ACTIVE prod

RUN unzip dist.zip -d ./front/
RUN tar -xzvf ./dependency/arthas.tar.gz
RUN mkdir /data/log

EXPOSE 8000

ENTRYPOINT ["bash","./entrypoint.sh"]